const inquirer = require("inquirer");

inquirer
  .prompt([
      {
          type: "list",// rawlist 与list唯一区别为下方有一个Answer提示
          name: "choice",// 必传  作为键值对中key出现
          message: "your choice",
          default: 1,
          choices: [
            {
              value: "value1",
              name: "name1"
            },
            {
              value: "value2",
              name: "name2"
            },
            {
              value: "value3",
              name: "name3"
            }
          ]
      },
  ])
  .then((answers) => {
      console.log(answers);
    // Use user feedback for... whatever!!
  })
  .catch((error) => {
    if (error.isTtyError) {
      // Prompt couldn't be rendered in the current environment
    } else {
      // Something else went wrong
    }
  });
